<div class="form-container">
<div class="validation-errors" id="validationErrors" style="display:none;"></div>
<?php
	Includes::IncludeFile( Includes::$FORM );
	Includes::IncludeFile( Includes::$SPACER );
	
	echo( form_open(base_url() . 'cmb/member/forgot_password_process/', array('id' => 'forgotPasswordForm') ) );
	
	Spacer::Render(0,20);
	
	Form::OpenFormItem('Last Name*:', 100);
		echo( form_input(array('name'=>'personLN','id'=>'personLN','maxlength'=>'32','style'=>'width:150px;')) );
	Form::CloseFormItem();
	Form::OpenFormItem('Email*:', 100);
		echo( form_input(array('name'=>'personEmail','id'=>'personEmail','maxlength'=>'128','style'=>'width: 250px;')) );
	Form::CloseFormItem();

	//Display Captcha image and input field
	Spacer::Render(0,20);
    echo('<div>');
    echo('If you don\'t remember the exact last name and email you used to register, please contact us at: '.safe_mailto('cmbproject@gmail.com','Contact Us'));
    echo('</div>');
	//echo $recaptcha;
	//Spacer::Render(0,10);
	//echo( form_input(array('name'=>'recaptcha_challenge_field','id'=>'recaptcha_challenge_field','style'=>'clear: left; display: block; float: left; vertical-align: middle; margin: 0 0 0 0; width: 100px;','onClick'=>'sponsorHandler();')) );			
	//echo ( form_label('<font size="2" weight="normal" color="black">Enter Characters</font>','captcha',array('class'=>'captcha','style'=>'display: block; float: left; vertical-align: middle; padding: 0 0 7px 0; margin: 0px 0 0 7px; white-space: nowrap; width: 100px;')) );

	echo( form_close() );		
?>
	<div class="form-button-container">
		<a href="javascript: validate();"><img src="<?php echo( base_url() );?>assets/images/buttons/submit_off.gif" border="0" onmouseover="this.src = '<?php echo( base_url() );?>assets/images/buttons/submit_over.gif';" onmousedown="this.src = '<?php echo( base_url() );?>assets/images/buttons/submit_on.gif';" onmouseup="this.src = '<?php echo( base_url() );?>assets/images/buttons/submit_off.gif';" onmouseout="this.src = '<?php echo( base_url() );?>assets/images/buttons/submit_off.gif';" /></a>
	</div>
</div>

<script type="text/javascript">
	function validate()
	{
		new Ajax.Request(baseUrl + 'validation/login_validation/validate_forgot_password/', 
		{
			method:'post',
			parameters: Form.serialize( $('forgotPasswordForm') ),
		  	onSuccess: function(response)
			{
				var result = response.responseText;
				
				if( result == 'VALIDATION_SUCCESS' )
				{
					$('forgotPasswordForm').submit();
				}
				else
				{
					$('validationErrors').innerHTML = result;
					$('validationErrors').show();
					Effect.ScrollTo('validationErrors', { duration:'0.2', offset:-20 });
				}
			},
			onFailure: function(response){var result = response.responseText; $('validationErrors').innerHTML = result;
					$('validationErrors').show();alert('failed') }
		});
	}
</script>

